Skip to content

[Infra] Support .NET 11#6899

Draft
martincostello wants to merge 87 commits into
open-telemetry:mainfrom
martincostello:dotnet-vnext
Draft

[Infra] Support .NET 11#6899
martincostello wants to merge 87 commits into
open-telemetry:mainfrom
martincostello:dotnet-vnext

Conversation

@martincostello

Copy link
Copy Markdown
Member

The intention is to keep this PR updated over the course of .NET 11's development as new previews are released.

Changes

Add support for building and testing with .NET 11.

  • Build with .NET 11 SDK
  • Add net11.0 target
  • Drop net8.0 and net9.0 targets

TODO

  • Use stable (or RC) SDK and NuGet package versions
  • Use fully-qualified container image tags (i.e. not 11.0-preview)
  • Remove workarounds for .NET 11 preview issues

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions Bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file documentation Documentation related pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry.Extensions.Hosting Issues related to OpenTelemetry.Extensions.Hosting NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package labels Feb 15, 2026
Comment thread src/OpenTelemetry.Exporter.Prometheus.HttpListener/PrometheusHttpListener.cs Outdated
@codecov

codecov Bot commented Feb 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.11111% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.20%. Comparing base (867c749) to head (d73584a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...penTelemetryProtocol/PersistentStorage/FileBlob.cs 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6899      +/-   ##
==========================================
- Coverage   90.21%   90.20%   -0.02%     
==========================================
  Files         290      290              
  Lines       15967    15982      +15     
==========================================
+ Hits        14405    14416      +11     
- Misses       1562     1566       +4     
Flag Coverage Δ
unittests-PowerShellScripts 87.43% <ø> (ø)
unittests-Project-Experimental 90.16% <86.11%> (-0.15%) ⬇️
unittests-Project-Stable 90.05% <86.11%> (-0.24%) ⬇️
unittests-Solution 90.24% <86.11%> (+<0.01%) ⬆️
unittests-UnstableCoreLibraries-Experimental 51.10% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nTelemetry.Api/Context/Propagation/B3Propagator.cs 89.83% <100.00%> (ø)
...metry.Api/Context/Propagation/BaggagePropagator.cs 93.78% <100.00%> (ø)
....Api/Context/Propagation/TraceContextPropagator.cs 90.49% <100.00%> (ø)
...c/OpenTelemetry.Api/Logs/LogRecordAttributeList.cs 74.78% <100.00%> (ø)
...yProtocol/Implementation/OtlpCertificateManager.cs 76.47% <ø> (-0.18%) ⬇️
...TelemetryProtocol/OtlpExporterOptionsExtensions.cs 99.10% <100.00%> (+<0.01%) ⬆️
...tocol/PersistentStorage/PersistentStorageHelper.cs 48.86% <100.00%> (+5.82%) ⬆️
.../PrometheusExporterApplicationBuilderExtensions.cs 100.00% <100.00%> (ø)
...rometheusExporterEndpointRouteBuilderExtensions.cs 100.00% <100.00%> (ø)
...ner/Internal/Shared/PrometheusCollectionManager.cs 90.68% <100.00%> (ø)
... and 7 more

... and 2 files with indirect coverage changes

@github-actions github-actions Bot added pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.Console Issues related to OpenTelemetry.Exporter.Console NuGet package labels Feb 15, 2026
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Feb 15, 2026
Update some references to .NET 8 to .NET 10 that were flushed out while working on open-telemetry#6899.
@Kielek Kielek added the keep-open Prevents issues and pull requests being closed as stale label Feb 16, 2026
- Add support for building and testing with .NET 11, initially using .NET 11 preview 1.
- Add `net11.0` TFMs.
- Drop `net8.0` and `net9.0` TFMs.
- Add workarounds for some issues pending their fixes.
Update System.Diagnostics.DiagnosticSource to 11.0.* that was missed in the previous commit and fix some missed analyzer warnings.
Copy-paste mistake.
Fix `NU1510` warning caused by workaround for aspnetcore issue.
Update CompatibilitySuppressions for .NET 11.
Add missing final new line.
@martincostello

This comment was marked as resolved.

@martincostello

This comment was marked as resolved.

@martincostello

Copy link
Copy Markdown
Member Author

Commit that should fix all the warnings just pushed. Will make a version targeting main tomorrow that doesn't contain C#-15-specific features (like [with(...)])- those specific changes can be reviewed and refined there (and potentially later broken up into smaller PRs by project).

@github-actions github-actions Bot added the pkg:OpenTelemetry.Exporter.InMemory Issues related to OpenTelemetry.Exporter.InMemory NuGet package label Mar 12, 2026
Populate switch statement to fix new analyser warning.
Suppress IDE0066 as otherwise it makes the code hard to read.
Comment thread Directory.Packages.props Outdated
Add missing override for newly added package.
@github-actions github-actions Bot added the pkg:OpenTelemetry.Shims.OpenTracing Issues related to OpenTelemetry.Shims.OpenTracing NuGet package label Jul 3, 2026
@github-actions github-actions Bot removed the pkg:OpenTelemetry.Shims.OpenTracing Issues related to OpenTelemetry.Shims.OpenTracing NuGet package label Jul 3, 2026
martincostello added a commit to martincostello/opentelemetry-dotnet that referenced this pull request Jul 10, 2026
Cherry-pick change from open-telemetry#6899 to fix new code analysis warning in .NET 11.
@martincostello martincostello changed the title Support .NET 11 [Infra] Support .NET 11 Jul 10, 2026
@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

  • Waiting on: Author
  • Next step: Move out of draft to request review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Documentation related infra Infra work - CI/CD, code coverage, linters keep-open Prevents issues and pull requests being closed as stale perf Performance related pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.Console Issues related to OpenTelemetry.Exporter.Console NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry.Extensions.Hosting Issues related to OpenTelemetry.Extensions.Hosting NuGet package pkg:OpenTelemetry.Extensions.Propagators Issues related to OpenTelemetry.Extensions.Propagators NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants